add_compile_definitions(ASIO_STANDALONE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
	add_compile_definitions(_WIN32_WINNT=0x0501)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    link_libraries(pthread)
endif()

set(TARGET chat_server)
file(GLOB_RECURSE source_files 	"${CMAKE_CURRENT_SOURCE_DIR}/chat_server.cpp"
								"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
								"${PROJECT_SOURCE_DIR}/*.editorconfig")
group_src_by_dir(source_files)
add_executable(${TARGET} ${source_files})
set_target_properties(${TARGET} PROPERTIES DEBUG_POSTFIX "_d")
set_target_properties(${TARGET} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../bin)
set_target_properties(${TARGET} PROPERTIES FOLDER ChatDemo)


set(TARGET chat_client)
file(GLOB_RECURSE source_files 	"${CMAKE_CURRENT_SOURCE_DIR}/chat_client.cpp"
								"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
								"${PROJECT_SOURCE_DIR}/*.editorconfig")
group_src_by_dir(source_files)
add_executable(${TARGET} ${source_files})
set_target_properties(${TARGET} PROPERTIES DEBUG_POSTFIX "_d")
set_target_properties(${TARGET} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../bin)
set_target_properties(${TARGET} PROPERTIES FOLDER ChatDemo)